<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<title><?php echo ($name); ?></title>
<script src="__APP__/statics/jquery-1.9.1.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__APP__/statics/css/jNotify.jquery.css" />
<script type="text/javascript" src="__APP__/statics/jNotify.jquery.js"></script>
<style>
 body{font-family:"微软雅黑";font-size:12px;color:#666666;background-color:#F9F9F6}
 *{margin: 0;} 
 a{text-decoration:none}
 img{border:0px}
.cat{background-color:#F9F9F6;margin-left:10px;z-index:0;}
.cat_list:hover{background-color:#fff;}
.title{background:url("__APP__/statics/tbg.gif");font-weight:bold}

#save{text-align:center;border:0;width:100%;height:40px;background-color:#fff;position:fixed;left:0px;bottom:0px;z-index:999;border:1px solid #DFDFDF;background-color:#DFDFDF;padding:5px;height:20px}
</style>
<body>




<table bordercolor="#DDDFFF" border="1" width="100%" style="border-collapse: collapse" cellpadding="3">
	<tr height="17" align="center">
		<td class="title" width="100">卡号</td>
		<td class="title" width="100">面额</td>
		<td class="title" width="100">最低限额</td>
		<td class="title" width="100">优惠券数量</td>
		<td class="title" width="100">开始时间</td>
		<td class="title" width="100">失效时间</td>
		<td class="title" width="150">添加时间</td>
		<td class="title" width="40">删除</td>
		<td class="title" width="40">下载</td>
		<td class="title">　</td>
	</tr>
<?php if(is_array($coupons)): $i = 0; $__LIST__ = $coupons;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$coupons): $mod = ($i % 2 );++$i;?><tr height="20" bgcolor="#F1F5FA" class="cat_list" align="center">
		<td width="100" style="font-weight:bold"><a href="javascript:look(<?php echo ($coupons["cou_id"]); ?>);"><?php echo ($coupons["cou_id"]); ?></a></td>
		<td width="100">￥<?php echo ($coupons["cou_amount"]); ?></td>
		<td width="100">￥<?php echo ($coupons["min_money"]); ?></td>
		<td width="100"><?php echo ($coupons["num"]); ?></td>
		<td width="80"><?php echo (date("Y-m-d",$coupons["begin_time"])); ?></td>
		<td align="center"><?php echo (date("Y-m-d",$coupons["end_time"])); ?></td>
		<td width="150"><?php echo (date("Y-m-d H:i:s",$coupons["add_time"])); ?></td>
		<td width="40"><a href="javascript:;" onclick="del(<?php echo ($coupons["cou_id"]); ?>)"><img alt="删除" src="__APP__/statics/icons/icon_delete.gif"></a></td>
		<td width="40"><a href="__URL__/download/?id=<?php echo ($coupons["cou_id"]); ?>"><img alt="下载" src="__APP__/statics/icons/icon_desc.gif"></a></td>
		
		<td></td>
	</tr><?php endforeach; endif; else: echo "" ;endif; ?>
</table>

<script src="__APP__/statics/webox/webox.js"></script>
<link href="__APP__/statics/webox/jquery-webox.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function look(t){
		$.webox({
			height:450,
			width:950,
			bgvisibel:true,
			title:'优惠券列表',
			iframe:'__URL__/cou_detail/id/'+t
		});
}

function del(t){
    var id=t;
	if(confirm('你确定要删除此卡号下的所有优惠券吗？此操作将使此卡号对应的优惠券全部失效，请谨慎操作！！！')) {
	     $.ajax({
		      type:"POST",
			  url:"__URL__/del/?type=all",
			  dataType:"json",
			  data:{'id':id},
			  success:function(data){
			  				   jSuccess("<strong>删除成功！</strong>",{TimeShown : 500,VerticalPosition : 'center',HorizontalPosition : 'center',onClosed:function(){location.reload();}})
              }
		})
	}
}
</script>